/* ═══════════════════════════════════════════════════════════
   J1 TTS — Design System
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --primary: #ffffff;
  --primary-dim: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.04);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.85);
  --text-dim: rgba(255, 255, 255, 0.65);
  --bg-base: #0d0d12;
  --bg-sidebar: rgba(10, 10, 16, 0.9);
  --success: #30d158;
  --error: #ff453a;
  --warning: #ffd60a;
  --sidebar-width: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Sidebar is fixed; body padding-left = sidebar width + gap */
  padding: 12px 16px 40px calc(var(--sidebar-width) + 16px);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

/* ── Background lights (exact match from original SoE TTS) ── */
.bg-light {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}
.light-1 {
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0) 60%);
  top: -20%;
  left: -10%;
  animation: float1 30s infinite ease-in-out alternate;
}
.light-2 {
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, rgba(0,0,0,0) 60%);
  bottom: -10%;
  right: -10%;
  animation: float2 25s infinite ease-in-out alternate;
}
@keyframes float1 {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(15vw, 10vh) scale(1.1); }
  100% { transform: translate(5vw, -10vh) scale(1.05); }
}
@keyframes float2 {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(-15vw,-15vh) scale(1.15); }
  100% { transform: translate(-5vw, 10vh) scale(0.95); }
}

/* ── Sidebar ──────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  z-index: 100;
}
.sidebar-content { display: flex; flex-direction: column; flex: 1; }
.floating-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 24px;
}
.brand-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.floating-header h1 {
  font-size: 16px; font-weight: 600;
  color: var(--text-main);
}

/* ── Nav ──────────────────────────────────────────── */
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.nav-item svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }
.nav-item:hover { background: var(--glass-hover); color: var(--text-main); }
.nav-item.active {
  background: var(--primary-dim);
  color: var(--text-main);
  border-color: rgba(255,255,255,0.1);
}

/* ── Layout (identical structure to original SoE TTS) ── */
.layout-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 1500px;
  height: fit-content;
  /* body already has padding-left for sidebar; center within remaining space */
}

/* ── Views: hide all, show active ── */
.view-section {
  display: none !important;
  width: 100%;
}
.view-section.active {
  display: flex !important;
}

/* main-content provides flex layout to active view */
.main-content {
  flex: 1;
  display: flex;           /* must be explicit here for flex-wrap to work */
  flex-wrap: wrap;         /* Item 8: panels stack when zoomed in or viewport narrow */
  gap: 20px;
  min-width: 0;
  align-items: flex-start;
}

/* ── Columns ── */
.left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Right column: FIXED width + FIXED height (matches original) */
/* This keeps Voice Library always beside Generate Audio */
/* With flex-wrap on parent, this collapses below left column when zoomed */
.right-column {
  width: 360px;
  min-width: 300px;        /* allow slight squeeze before wrapping */
  flex-shrink: 0;          /* don't shrink — wrap instead */
  height: 680px;
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
}

/* ── Library view: full-width, scrollable internally ── */
#view-library.active {
  flex-direction: column;
  height: calc(100vh - 80px);
  overflow: hidden;
}

/* ── Glass Panel ──────────────────────────────────── */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
}

/* ── Editor Panel: never stretches (flex:none like original) ── */
.editor-panel { flex: none; min-height: 280px; }
.panel-header {
  padding: 20px 24px 16px;
}
.panel-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}
.panel-header h2 svg { stroke: var(--text-main); opacity: 0.7; }
.panel-header p {
  font-size: 12px;
  color: var(--text-muted);
}
.upload-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.upload-btn:hover { background: rgba(255,255,255,0.1); }
.upload-btn svg { stroke: currentColor; }
.clear-btn {
  cursor: pointer;
  text-decoration: underline;
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 16px;
  background: none;
  border: none;
  font-family: inherit;
  transition: color 0.15s;
}
.clear-btn:hover { color: var(--text-main); }

/* ── Editor Body ──────────────────────────────────── */
.editor-body { padding: 0 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.drop-zone {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.drop-zone.dragover { box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }
#scriptTextarea {
  width: 100%;
  min-height: 160px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
  padding-bottom: 40px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
#scriptTextarea:focus { border-color: rgba(255,255,255,0.2); }
#scriptTextarea::placeholder { color: var(--text-dim); }

.char-count {
  position: absolute;
  bottom: 12px; right: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  background: rgba(10,10,18,0.88);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.file-name-group {
  display: flex; align-items: center; gap: 10px; flex: 1;
}
.file-name-label {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  white-space: nowrap;
}
.file-name-input {
  flex: 1;
  max-width: 280px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.file-name-input:focus { border-color: rgba(255,255,255,0.2); }
.file-name-input::placeholder { color: var(--text-dim); }

/* File chips */
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--glass-hover);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 11px; color: var(--text-muted);
}
.file-chip .remove-chip {
  cursor: pointer; color: var(--text-dim);
  transition: color 0.15s; line-height: 1;
}
.file-chip .remove-chip:hover { color: var(--error); }

/* ── Results Panel: grows with content, never stretches (flex:none) ── */
.results-panel { flex: none; height: auto; }
.results-panel .panel-header { padding-bottom: 0; }
.results-panel .panel-header h2 span { color: var(--text-muted); font-weight: 400; margin-left: 8px; }

/* ── Table ───────────────────────────────────── */
.table-container {
  width: 100%;
  padding-bottom: 12px;
}
#view-library .table-container {
  flex: 1;
  overflow-y: auto;
}
.table-min-width { min-width: 600px; }
.table-header {
  display: grid;
  grid-template-columns: 50px 2fr 1.2fr 130px 2fr 100px;
  column-gap: 16px;
  padding: 10px 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: rgba(13,13,15,0.85);
  backdrop-filter: blur(20px);
  z-index: 10;
  border-bottom: 1px solid var(--glass-border);
}
.table-row {
  display: grid;
  grid-template-columns: 50px 2fr 1.2fr 130px 2fr 100px;
  column-gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  align-items: center;
  transition: background 0.15s;
  font-size: 14px;
}
.table-row.has-error { align-items: start; padding-bottom: 0; }
.error-row-below {
  padding: 5px 24px 12px 74px;
  font-size: 11px;
  color: #ff3b30;
  line-height: 1.6;
  word-break: break-word;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.table-row:hover { background: rgba(255,255,255,0.02); }
.col-checkbox { display: flex; align-items: center; }
.col-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.col-checkbox input[type="checkbox"]:checked { background: white; border-color: white; }
.col-checkbox input[type="checkbox"]:checked::after { content: ''; display: block; width: 4px; height: 8px; border: solid black; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -1px auto 0; }

/* ── Voices Panel: fills the fixed-height right column ── */
/* right-column has fixed height; voices-panel fills it and scrolls inside */
.voices-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.voices-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 8px 16px 16px;
}
.voice-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.voice-item:hover { background: var(--glass-hover); }
.voice-item.selected {
  background: var(--primary-dim);
  border-color: rgba(255,255,255,0.12);
}
.voice-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: var(--text-main);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.voice-info { flex: 1; min-width: 0; }
.voice-name { font-size: 13px; font-weight: 500; color: var(--text-main); }
.voice-tags { font-size: 11px; color: var(--text-muted); }
.voice-check { color: var(--success); opacity: 0; transition: opacity 0.15s; }
.voice-item.selected .voice-check { opacity: 1; }

/* ── Buttons ──────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  background: var(--primary);
  color: #0d0d12;
  border: none;
  border-radius: 9px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-primary:hover { background: rgba(255,255,255,0.85); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,255,255,0.15); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn-primary svg { stroke: currentColor; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: var(--glass-hover);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
.btn-secondary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-secondary svg { stroke: currentColor; }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 10px;
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(255,69,58,0.2);
  border-radius: 7px;
  font-size: 12px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: rgba(255,69,58,0.1); }

/* ── Status badges — SoE TTS exact ───────────────── */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 100px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-Completed { color: #34c759; background: rgba(52,199,89,0.1); border: 1px solid rgba(52,199,89,0.2); }
.badge-Processing { color: #60a5fa; background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.25); }
.badge-Finalizing { color: #bae6fd; background: rgba(186,230,253,0.12); border: 1px solid rgba(186,230,253,0.3); }
.badge-Error { color: #ff3b30; background: rgba(255,59,48,0.1); border: 1px solid rgba(255,59,48,0.2); }
.badge-Waiting  { color: #f59e0b; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); }
.badge-Retrying { color: #fb923c; background: rgba(251,146,60,0.12); border: 1px solid rgba(251,146,60,0.25); animation: pulse-retrying 1.4s ease-in-out infinite; }
@keyframes pulse-retrying { 0%,100%{ opacity:1; } 50%{ opacity:0.55; } }
@keyframes spin { 100% { transform: rotate(360deg); } }
.spin-icon { animation: spin 2s linear infinite; }

/* ── Custom audio player — SoE TTS ───────────────── */
audio { height: 26px; max-width: 180px; border-radius: 6px; }
.col-player { display: flex; align-items: center; gap: 12px; }
.play-btn { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.08); border: none; color: var(--text-main); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
.play-btn:hover { background: rgba(255,255,255,0.15); }
.play-btn svg { width: 12px; height: 12px; margin-left: 1px; }
.player-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.player-track { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; position: relative; display: flex; align-items: center; cursor: pointer; min-width: 60px; }
.player-progress { height: 100%; background: #60a5fa; border-radius: 2px; width: 0%; transition: width 0.3s; }
.player-dot { width: 10px; height: 10px; background: #60a5fa; border-radius: 50%; position: absolute; top: -3px; box-shadow: 0 0 8px rgba(96,165,250,0.6); pointer-events: none; }
.player-dash { color: var(--text-muted); font-size: 16px; }

/* Shimmer bar — indeterminate progress for processing/queued rows */
@keyframes shimmer-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}
.shimmer-bar {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,0.6), transparent);
  border-radius: 2px;
  animation: shimmer-slide 1.6s ease-in-out infinite;
}

.progress-fill-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(96,165,250,0.7), rgba(59,130,246,0.9));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── File action buttons — SoE TTS ───────────────── */
.file-actions { display: flex; gap: 6px; justify-content: flex-end; width: 100%; align-items: center; }
.file-btn { border: none; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.2s; display: inline-flex; align-items: center; justify-content: center; background: transparent; font-family: inherit; text-decoration: none; }
.file-btn.text-btn { padding: 6px 12px; }
.file-btn.icon-only { padding: 7px; }
.file-btn.generate { background: var(--primary); color: #000; }
.file-btn.generate:hover { background: rgba(255,255,255,0.85); }
.file-btn.delete { background: rgba(255,59,48,0.1); color: #ff3b30; }
.file-btn.delete:hover { background: rgba(255,59,48,0.2); }
.file-btn.cancel { background: rgba(255,150,0,0.1); color: #ff9600; }
.file-btn.cancel:hover { background: rgba(255,150,0,0.2); }
.file-btn.retry { background: rgba(255,255,255,0.08); color: #ffffff; border: 1px solid rgba(255,255,255,0.14); }
.file-btn.retry:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.3); }
.file-btn.dl { background: rgba(255,255,255,0.06); color: var(--text-main); }
.file-btn.dl:hover { background: rgba(255,255,255,0.12); }

/* ── Maintenance banner — inline top of generate view ─ */
.maintenance-banner {
  flex: 0 0 100%;
  width: 100%;
  background: rgba(18, 16, 6, 0.96);
  border: 1px solid rgba(255,214,10,0.5);
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
  transition: box-shadow 0.2s;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 4px;
}
.maintenance-banner:hover { box-shadow: 0 4px 20px rgba(255,214,10,0.15); }
.maint-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
}
.maint-preview-text { font-size: 13px; font-weight: 500; color: rgba(255,214,10,0.95); }
.maint-chevron { font-size: 11px; color: rgba(255,214,10,0.6); margin-left: auto; transition: transform 0.2s; }
.maint-chevron.open { transform: rotate(180deg); }
.maint-details {
  display: none;
  padding: 0 16px 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.60);
  line-height: 1.7;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid rgba(255,214,10,0.12);
}

/* ── Voice Library Tips button ─────────────────────── */
.library-tips-btn {
  padding: 5px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.library-tips-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  color: var(--text-main);
}

/* ── Tips modal overlay ────────────────────────────── */
.tips-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tips-modal {
  background: rgba(22,22,30,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 28px 28px 24px;
  max-width: 480px;
  width: 100%;
  max-height: 72vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.tips-modal h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  padding-right: 28px;
}
.tips-modal-body {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255,255,255,0.72);
  white-space: pre-wrap;
}
.tips-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  display: flex;
  line-height: 0;
}
.tips-modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }

/* ── Checkbox ─────────────────────────────────────── */
input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--text-main);
  cursor: pointer;
}

/* ── Spinner ──────────────────────────────────────── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.7);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-dim); text-align: center; gap: 10px;
}
.empty-state svg { stroke: currentColor; opacity: 0.3; }
.empty-state p { font-size: 12px; max-width: 200px; }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #16161e;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: 520px; max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.close-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-hover); border: none; border-radius: 6px;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.close-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.08); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Input group ──────────────────────────────────── */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.input-group input,
.input-group textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 10px 14px;
  color: var(--text-main); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color 0.2s; width: 100%;
}
.input-group input:focus,
.input-group textarea:focus { border-color: rgba(255,255,255,0.2); }
.input-group textarea { resize: vertical; min-height: 80px; }

/* ── Toggle switch ────────────────────────────────── */
.toggle-switch { position: relative; width: 38px; height: 20px; display: inline-block; }
.toggle-switch input { display: none; }
.slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .slider { background: rgba(255,255,255,0.5); }
.toggle-switch input:checked + .slider::before { transform: translateX(18px); }

/* ── Toast ────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end;
}
.toast {
  padding: 10px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  backdrop-filter: blur(12px);
  animation: toastIn 0.25s ease, toastOut 0.25s ease 3.75s forwards;
  max-width: 320px;
}
.toast.success { background: rgba(48,209,88,0.15); border: 1px solid rgba(48,209,88,0.2); color: var(--success); }
.toast.error { background: rgba(220, 38, 38, 0.95); border: 1px solid #ef4444; color: #ffffff; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3); font-weight: 600; }
.toast.info { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: var(--text-main); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vsGuideIn { from { opacity: 0; transform: scale(0.88) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }


/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ── Auth guard ───────────────────────────────────── */
#auth-overlay {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  flex-direction: column; gap: 16px; text-align: center;
}
#auth-overlay .brand-icon { width: 52px; height: 52px; margin: 0 auto; }
#auth-overlay .brand-icon img { width: 100%; height: 100%; object-fit: contain; }
#auth-overlay p { font-size: 13px; color: var(--text-muted); }
.spinner-lg {
  width: 28px; height: 28px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: rgba(255,255,255,0.5);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--primary);
  color: #0d0d12;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  margin-top: 8px;
}
.btn-cta:hover { background: rgba(255,255,255,0.85); transform: translateY(-1px); }

/* ── View hidden ──────────────────────────────────── */
.view-section { display: none; }
.view-section.active { display: flex; }

/* ── Admin login (for ademir.html) ────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 380px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 24px;
  text-align: center;
}
.login-card .brand-icon { width: 52px; height: 52px; margin: 0 auto; }
.login-card .brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.login-card h2 { font-size: 18px; font-weight: 600; color: var(--text-main); }
.login-card p { font-size: 13px; color: var(--text-muted); margin-top: -12px; }
.login-fields { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: rgba(255,255,255,0.25); }
.login-input::placeholder { color: var(--text-dim); }
.login-error {
  font-size: 12px; color: var(--error);
  background: rgba(255,69,58,0.08);
  border: 1px solid rgba(255,69,58,0.15);
  border-radius: 8px; padding: 8px 12px;
  display: none;
}
.login-error.show { display: block; }

/* ═══════════════════════════════════════════════════
   GROUP C UI FIXES — v10
   ═══════════════════════════════════════════════════ */

/* Item 29 — Voice name white in results/history */
.col-voice-name { color: var(--text-main) !important; font-size: 13px; }

/* Item 10b — Download button white, Clear All matches Retry style */
#btn-download {
  background: white !important;
  color: #0d0d12 !important;
  border-color: transparent !important;
}
#btn-download:hover {
  background: rgba(255,255,255,0.85) !important;
}
#btn-download:disabled { background: rgba(255,255,255,0.15) !important; color: rgba(0,0,0,0.4) !important; }

#btn-clear-results, #btn-retry-all {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}
#btn-clear-results:hover, #btn-retry-all:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
}
#btn-clear-results svg, #btn-retry-all svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}


/* Item 11 — Download icon in result row: white */
.file-btn.dl {
  background: rgba(255,255,255,0.12) !important;
  color: white !important;
  border: 1px solid rgba(255,255,255,0.15);
}
.file-btn.dl:hover { background: rgba(255,255,255,0.22) !important; }

/* Item 8 — Responsive zoom / layout */
/* Triggers when viewport is narrow (small screen OR high browser zoom) */
@media (max-width: 1100px) {
  .right-column { width: 100% !important; min-width: unset !important; height: auto !important; max-height: 400px; flex-shrink: unset !important; }
  .voices-body { max-height: 300px; }
}
@media (max-width: 820px) {
  body { padding-left: calc(var(--sidebar-width) + 8px) !important; padding-right: 8px !important; }
  .table-header, .table-row { grid-template-columns: 40px 1fr 100px 2fr 90px !important; }
  .table-header > *:nth-child(3),
  .table-row > *:nth-child(3) { display: none; }
}
/* Scale UI at very small viewport */
@media (max-width: 600px) {
  body { font-size: 12px; padding: 8px 8px 8px calc(var(--sidebar-width) + 8px) !important; }
}

/* Item 20 — Admin panel: white background glow */
.admin-sidebar { position: relative; }
.admin-sidebar::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Item 20 — Admin: brighter text */
.admin-card h3 { color: rgba(255,255,255,0.92) !important; }
.admin-card label, .admin-card .form-label { color: rgba(255,255,255,0.80) !important; }
.admin-content p { color: rgba(255,255,255,0.65) !important; }

/* Item 4 — Logs dropdown (select) styled */
select.form-select, .admin-content select {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  color: rgba(255,255,255,0.85) !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 32px !important;
  cursor: pointer;
}
select.form-select option, .admin-content select option {
  background: #1a1a24 !important;
  color: rgba(255,255,255,0.85) !important;
}

/* Item 23 — Voices admin: white text */
.voices-table td { color: rgba(255,255,255,0.88) !important; }
.voices-table th { color: rgba(255,255,255,0.50) !important; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.voice-id-cell { color: white !important; font-family: monospace; font-size: 12px; }

/* Item 25 — Users tab save button white */
.btn-save-user, #btn-save-settings {
  background: white !important; color: #0d0d12 !important;
}
.btn-save-user:hover, #btn-save-settings:hover { background: rgba(255,255,255,0.85) !important; }

/* Item 26 — Logs: brighter text + status highlight */
.log-row { color: rgba(255,255,255,0.80) !important; }
.log-action { font-weight: 600; }
.log-action.generation_completed { color: #34c759; }
.log-action.generation_failed, .log-action.generation_error { color: #ff3b30; }
.log-action.user_banned { color: #ff9600; }
.log-action.maintenance_on, .log-action.maintenance_off { color: #a855f7; }
.log-level-ERR, .log-level-ERROR { color: #ff3b30 !important; }
.log-level-WARN { color: #ff9600 !important; }
.log-level-INFO { color: #34c759 !important; }

/* Item 19 — Custom confirm dialog */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.confirm-overlay.show { opacity: 1; pointer-events: all; }
.confirm-dialog {
  background: rgba(22,22,34,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 32px 28px 24px;
  max-width: 360px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 16px;
  text-align: center;
}
.confirm-dialog h4 { font-size: 16px; font-weight: 600; color: var(--text-main); }
.confirm-dialog p { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.6; }
.confirm-dialog-actions { display: flex; gap: 10px; justify-content: center; margin-top: 4px; }
.confirm-btn-cancel {
  padding: 10px 22px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); color: var(--text-main);
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.confirm-btn-cancel:hover { background: rgba(255,255,255,0.12); }
.confirm-btn-delete {
  padding: 10px 22px; border-radius: 10px; border: none;
  background: rgba(255,59,48,0.15); color: #ff3b30;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.confirm-btn-delete:hover { background: rgba(255,59,48,0.25); }

/* Item 22 — Profile checkboxes */
.profile-row-cb { width: 16px; height: 16px; accent-color: white; cursor: pointer; }
.profiles-bulk-actions {
  display: none;
  gap: 8px; align-items: center; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}
.profiles-bulk-actions.show { display: flex; }

/* Item 31 — Profile counters */
.profiles-counter {
  display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.profiles-counter-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; gap: 2px;
}
.profiles-counter-item span:first-child { font-size: 22px; font-weight: 700; color: var(--text-main); }
.profiles-counter-item span:last-child { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.counter-active span:first-child { color: #34c759; }
.counter-inactive span:first-child { color: #ff3b30; }


/* ── Item 24 — Usage limit circle (inside sidebar) ─── */
.usage-circle-wrap {
  display: flex;                        /* always visible — JS updates content */
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: auto 0 8px;                   /* push to bottom of sidebar flex */
  border-top: 1px solid rgba(255,255,255,0.07);
}
.usage-circle-wrap.show { display: flex; } /* kept for compat, noop now */

.usage-circle {
  position: relative;
  width: 54px; height: 54px;
  cursor: default;
  flex-shrink: 0;
}
.usage-circle svg { transform: rotate(-90deg); }
.usage-circle-track { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 4; }
.usage-circle-fill  { fill: none; stroke: white; stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.5));
  transition: stroke-dashoffset 0.6s ease; }
.usage-circle-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: white;  /* big visible ∞ */
  line-height: 1;
  letter-spacing: -1px;
}
.usage-circle-sublabel {
  font-size: 11px; color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

/* Item 25 — Users save button white */
.btn-save-user, button[id^="btn-save-user"], #btn-save-user {
  background: white !important;
  color: #0d0d12 !important;
  border-color: transparent !important;
  font-weight: 600;
}
.btn-save-user:hover { background: rgba(255,255,255,0.85) !important; }

/* Item 21a — Admin tab SVG alignment */
.admin-tab { display: flex; align-items: center; gap: 8px; }
.admin-tab svg { flex-shrink: 0; opacity: 0.75; }
.admin-tab.active svg { opacity: 1; }

/* ═══════════════════════════════════════════════════
   VOICE FILTER TABS (in Generate Audio voice library)
   ═══════════════════════════════════════════════════ */
.voice-filter-tabs {
  display: flex; gap: 0; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.voice-filter-tab {
  background: none; border: none; color: var(--text-muted); padding: 10px 16px;
  font-size: 13px; font-weight: 500; cursor: pointer; position: relative;
  transition: color .2s;
}
.voice-filter-tab:hover { color: var(--text-primary); }
.voice-filter-tab.active { color: #fff; }
.voice-filter-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 8px; right: 8px;
  height: 2px; background: #fff; border-radius: 1px;
}

/* ═══════════════════════════════════════════════════
   VOICE STUDIO
   ═══════════════════════════════════════════════════ */
.vs-tabs {
  display: flex; gap: 0; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.vs-tab {
  background: none; border: none; color: var(--text-muted); padding: 14px 18px;
  font-size: 13.5px; font-weight: 500; cursor: pointer; position: relative;
  transition: color .2s; font-family: inherit;
}
.vs-tab:hover { color: var(--text-primary); }
.vs-tab.active { color: #fff; }
.vs-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 8px; right: 8px;
  height: 2px; background: #fff; border-radius: 1px;
}
.vs-tab-disabled {
  color: rgba(255,255,255,0.15) !important; cursor: not-allowed !important;
}
.vs-tab-disabled:hover { color: rgba(255,255,255,0.15) !important; }

.vs-tab-content {
  display: none; flex: 1; overflow-y: auto; padding: 24px;
}
.vs-tab-content.active { display: block; }
#vs-voice-list, #vs-my-voices { padding-top: 4px !important; }

/* Voice grid (Voice List / My Voices) */
.vs-voice-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(345px, 1fr));
  gap: 14px;
}
.vs-voice-card {
  background: linear-gradient(135deg, rgba(28,28,40,0.95), rgba(15,15,22,0.98));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; padding: 12px 16px 8px 16px; cursor: default;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  position: relative;
  min-height: 118px;
  transition: all .25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.vs-voice-card:hover, .vs-voice-card.selected { 
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.3), 0 0 6px rgba(255, 255, 255, 0.5), 0 10px 30px rgba(0,0,0,0.85);
  transform: translateY(-2px);
}
.vs-card-top-row {
  display: flex; align-items: flex-start; gap: 12px; position: relative; flex: 1; margin-bottom: 0px;
}
.vs-card-icon-wrap {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.vs-card-info { flex: 1; min-width: 0; padding-right: 26px; }
.vs-voice-card-name {
  font-weight: 700; font-size: 15.5px; color: #ffffff;
  text-shadow: 1.5px 1.5px 0 #000, -1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px -1.5px 0 #000, 0 2px 6px rgba(0,0,0,0.9);
  letter-spacing: 0.02em; line-height: 1.25;
  word-break: break-word; margin-bottom: 4px;
}
.vs-voice-card-tags-wrap {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px;
}
.vs-tag-pill {
  font-size: 11px; font-weight: 600; color: #ffffff;
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px; padding: 2px 7px; line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.vs-card-kebab-wrap { position: absolute; top: 0; right: 0; }
.vs-kebab-btn {
  background: transparent; border: none; color: rgba(255,255,255,0.7);
  padding: 5px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.vs-kebab-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
.vs-kebab-menu {
  position: absolute; right: 0; top: 30px; z-index: 100;
  background: rgba(18, 18, 28, 0.98); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px; padding: 6px; min-width: 135px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.95);
  display: none; flex-direction: column; gap: 4px;
}
.vs-kebab-menu.show { display: flex; }
.vs-kebab-item-edit {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 8px; transition: all .2s;
  width: 100%;
}
.vs-kebab-item-edit:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }
.vs-kebab-item-delete {
  background: rgba(255,59,48,0.15); border: 1px solid rgba(255,59,48,0.3);
  color: #ff3b30; padding: 8px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 8px; transition: all .2s;
  width: 100%;
}
.vs-kebab-item-delete:hover { background: rgba(255,59,48,0.25); border-color: rgba(255,59,48,0.5); color: #ff3b30; }
.vs-card-divider { height: 1px; background: rgba(255, 255, 255, 0.12); width: 100%; margin-top: auto; margin-bottom: 1px; }
.vs-use-voice-btn {
  width: 100%; background: rgba(255, 255, 255, 0.04); border: 1px solid transparent; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
.vs-use-voice-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  box-shadow: none !important;
  transform: none !important;
}
.vs-use-left { display: flex; align-items: center; gap: 10px; }
.vs-use-icon {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.65);
  display: flex; align-items: center; justify-content: center;
}

/* Real-time Search Bars */
.search-bar-container {
  display: flex; align-items: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px; padding: 0 12px; height: 38px; width: 100%; max-width: 300px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.search-bar-container:focus-within {
  border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}
.search-bar-icon { color: var(--text-muted); display: flex; align-items: center; margin-right: 10px; flex-shrink: 0; }
.search-bar-input { background: transparent; border: none; color: #fff; font-size: 13.5px; width: 100%; outline: none; }
.search-bar-input::placeholder { color: rgba(255, 255, 255, 0.45); }

/* Create Voice Form */
.vs-create-form { max-width: 680px; margin: 0 auto; }
.vs-create-top-row { display: flex; gap: 16px; margin-bottom: 16px; }
.vs-create-top-row .vs-input-group { flex: 1; }
.vs-input-group { display: flex; flex-direction: column; gap: 6px; }
.vs-input-group label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}
.vs-input-group input, .vs-input-group textarea {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 12px 14px; color: #fff; font-size: 14px;
  font-family: inherit; transition: border-color .2s; resize: vertical;
}
.vs-input-group input:focus, .vs-input-group textarea:focus {
  outline: none; border-color: rgba(255,255,255,0.2);
}
.vs-prompt-group { margin-bottom: 12px; }
.vs-prompt-counter {
  font-size: 11px; color: var(--text-muted); text-align: right; margin-top: 4px;
  transition: color .3s;
}
.vs-prompt-counter.ready { color: rgba(100,220,120,0.7); }

/* Action buttons */
.vs-action-row { display: flex; gap: 12px; margin-bottom: 24px; }
.vs-btn-generate, .vs-btn-regenerate {
  padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s; font-family: inherit; border: none;
}
.vs-btn-generate {
  background: #fff; color: #0d0d12;
}
.vs-btn-generate:hover:not(:disabled) { background: rgba(255,255,255,0.85); }
.vs-btn-generate:disabled { opacity: .35; cursor: not-allowed; }
.vs-btn-regenerate {
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.08);
}
.vs-btn-regenerate:hover:not(:disabled) {
  background: rgba(255,255,255,0.1); color: #fff;
}
.vs-btn-regenerate:disabled { opacity: .25; cursor: not-allowed; }

/* Preview cards */
.vs-previews { display: flex; gap: 20px; justify-content: center; margin-bottom: 24px; }
.vs-preview-card {
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.06);
  border-radius: 16px; padding: 28px 36px; display: flex; flex-direction: column;
  align-items: center; gap: 16px; cursor: pointer; transition: all .25s;
  min-width: 160px;
}
.vs-preview-card:hover { border-color: rgba(255,255,255,0.15); }
.vs-preview-card.selected {
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 20px rgba(255,255,255,0.08), inset 0 0 20px rgba(255,255,255,0.02);
}
.vs-preview-label { font-size: 15px; font-weight: 600; color: #fff; }
.vs-play-btn {
  width: 48px; height: 48px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.08); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.vs-play-btn:hover { background: rgba(255,255,255,0.15); }
.vs-play-btn.playing .play-icon { display: none; }
.vs-play-btn.playing .pause-icon { display: block !important; }

/* Save button */
.vs-save-row { display: flex; justify-content: center; padding: 8px 0 16px; }
.vs-btn-save {
  padding: 12px 36px; border-radius: 12px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; border: none;
  background: #fff; color: #0d0d12;
  box-shadow: 0 0 24px rgba(255,255,255,0.15), 0 0 60px rgba(255,255,255,0.06);
  transition: all .25s;
}
.vs-btn-save:hover:not(:disabled) {
  box-shadow: 0 0 32px rgba(255,255,255,0.25), 0 0 80px rgba(255,255,255,0.1);
}
.vs-btn-save:disabled { opacity: .3; cursor: not-allowed; box-shadow: none; }

/* Import locked */
.vs-import-locked {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; padding: 60px 20px; opacity: .4;
}
.vs-import-locked p { color: var(--text-muted); font-size: 14px; }
.vs-import-form-disabled { display: flex; gap: 8px; }
.vs-import-form-disabled input {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 8px 12px; color: var(--text-muted); width: 240px;
  font-size: 13px;
}
.vs-import-form-disabled button {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 8px 16px; color: var(--text-muted); font-size: 13px;
  cursor: not-allowed;
}

/* Voice Preview Audio Player Buttons */
.voice-preview-play-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  margin-right: 8px;
  flex-shrink: 0;
  transition: all 0.2s;
}
.voice-preview-play-btn:hover, .vs-preview-play-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments for tablets and smaller viewports */
@media (max-width: 1100px) {
  .vs-voice-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  }
}
@media (max-width: 768px) {
  .vs-voice-grid {
    grid-template-columns: 1fr;
  }
  .search-bar-container {
    max-width: 100% !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
    width: calc(100% - 24px) !important;
  }
}
